<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" isELIgnored="false"%>
<%@ include file="/common/backcommon.jsp" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
		<link rel="stylesheet" type="text/css" href="${base}/css/background_login.css" />
		<title>Breaking Fast</title>
		<script type="text/javascript">
			function login() {
				var email = $("#email").val();
				var password = $("#password").val();
				if("" == email.trim() || "" == password.trim()){
					jAlert("用户名密码不能为空");
					return;
				} else {
					$.ajax({
						url: "${base}/backUserCtl/backUserLogin",
						type: "post",
						data: {email: email,password: password},
						success: function(result){
							if(true == result) {
								location.href= "${base}/background/main.jsp"
							} else {
								alert("用户名密码错误！");
							}
						}
					});
				}
			}
		</script>
	</head>
	
	<body>
		<form:form action="${base}/userCtl/backUserLogin">
			<div class="cms_login">
				<ul>
			    	<li><em class="username">用户名：</em><input id="email" name="email" type="text" class="cms_text" /></li>
			        <li><em class="username">密码：</em><input id="password" name="password" type="password" class="cms_text" /></li>
			        <li class="cms_tishi">
			        	<span>
			        		<c:if test="${3 ne loginError}">用户名或密码错误</c:if>
			        	</span>
			        </li>
			        <li><input type="button" value="" class="cms_btn" onclick="login()" /></li>
			    </ul>
			</div>
		</form:form>
	</body>
</html>